This is a project to use plotly package to plot mtcars data
library(plotly)
## Loading required package: ggplot2
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(tidyr)
data("mtcars")
df <- data.frame(mtcars)
g <- ggplot(data=df, aes(x=wt, y=mpg))
Use Plotly package to plot the weight and miles per gallon variables in order to analyze the changes of weight miles per gallon.
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'